home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / earthlink / nscomm / java40.jar / java / io / FileInputStream.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-11-03  |  1.3 KB  |  66 lines

  1. package java.io;
  2.  
  3. public class FileInputStream extends InputStream {
  4.    // $FF: renamed from: fd java.io.FileDescriptor
  5.    private FileDescriptor field_0;
  6.  
  7.    public FileInputStream(String var1) throws FileNotFoundException {
  8.       System.getSecurityManager().checkRead(var1);
  9.  
  10.       try {
  11.          this.field_0 = new FileDescriptor();
  12.          this.open(var1);
  13.       } catch (IOException var2) {
  14.          throw new FileNotFoundException(var1);
  15.       }
  16.    }
  17.  
  18.    public FileInputStream(File var1) throws FileNotFoundException {
  19.       this(var1.getPath());
  20.    }
  21.  
  22.    public FileInputStream(FileDescriptor var1) {
  23.       if (var1 == null) {
  24.          throw new NullPointerException();
  25.       } else {
  26.          System.getSecurityManager().checkRead(var1);
  27.          this.field_0 = var1;
  28.       }
  29.    }
  30.  
  31.    private native void open(String var1) throws IOException;
  32.  
  33.    public native int read() throws IOException;
  34.  
  35.    private native int readBytes(byte[] var1, int var2, int var3) throws IOException;
  36.  
  37.    public int read(byte[] var1) throws IOException {
  38.       return this.readBytes(var1, 0, var1.length);
  39.    }
  40.  
  41.    public int read(byte[] var1, int var2, int var3) throws IOException {
  42.       return this.readBytes(var1, var2, var3);
  43.    }
  44.  
  45.    public native long skip(long var1) throws IOException;
  46.  
  47.    public native int available() throws IOException;
  48.  
  49.    public native void close() throws IOException;
  50.  
  51.    public final FileDescriptor getFD() throws IOException {
  52.       if (this.field_0 != null) {
  53.          return this.field_0;
  54.       } else {
  55.          throw new IOException();
  56.       }
  57.    }
  58.  
  59.    protected void finalize() throws IOException {
  60.       if (this.field_0 != null && this.field_0 != FileDescriptor.in) {
  61.          this.close();
  62.       }
  63.  
  64.    }
  65. }
  66.